home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Online / opennap / logchk < prev    next >
Text File  |  2001-06-08  |  631b  |  31 lines

  1. #!/bin/sh
  2. #
  3. # Simple BASH script to rotate the opennap logfile.
  4. #
  5. # Add this to your crontab to run the logchk script every 12 hours.
  6. #
  7. #    0 0,12 * * *   /home/mydir/logchk >/dev/null 2>&1
  8. #
  9. # 24 Hour format.
  10. #
  11. #    0 0 * * * /home/mydir/logchk >/dev/null 2>&1
  12. #
  13. #                            -- WoLf (itzwolf@usa.net)
  14.  
  15. # Set this to the opennap shared folder path (logfile location)
  16. LOGPATH=/home/wolf/opennap/share/opennap
  17.  
  18. # No need to change anything below here.
  19.  
  20. cd $LOGPATH
  21.  
  22. if test -r log ;then
  23.    if test -r log.yesterday ;then
  24.       rm -rf log.yesterday
  25.    fi
  26.    cp log log.yesterday
  27.    echo "" > log
  28.    exit 0
  29. fi
  30. exit 0
  31.